//
//  ExpertCell.m
//  DaJiang
//
//  Created by sally on 16/10/9.
//  Copyright © 2016年 jiniu. All rights reserved.
//

#import "ExpertCell.h"

@interface ExpertCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *descLabel;

@end

@implementation ExpertCell

- (void)awakeFromNib {
  [self initControl];
}

- (void)initControl {
  self.headImage.layer.cornerRadius = self.headImage.height / 2;
  self.headImage.layer.masksToBounds = YES;
}

- (void)setCellData:(UserModel *)cellData {
  [self.headImage sd_setImageWithURL:[NSURL URLWithString:cellData.user_data.user_profile_pic] placeholderImage:[UIImage imageNamed:@"ic_default"]];

  if (self.expertCellType == ExpertCellType_Mine) {
    self.name2Label.hidden = NO;
    self.nameLabel.hidden = YES;
    self.descLabel.hidden = YES;
    self.name2Label.text = cellData.user_data.user_name;
  }else{
    self.name2Label.hidden = YES;
    self.nameLabel.hidden = NO;
    self.descLabel.hidden = NO;
    self.nameLabel.text = cellData.user_data.user_name;
    self.descLabel.text = cellData.user_data.user_pro_title;
  }
}

@end
